// 测试后端API连接的简单脚本
// 运行方式: node src/test-api.js

import fetch from 'node-fetch';

async function testHistoryAPI() {
  try {
    const response = await fetch('http://localhost:8000/chat/history?user_id=5');
    const data = await response.json();
    console.log('API响应:', data);
    return data;
  } catch (error) {
    console.error('API请求失败:', error);
    return null;
  }
}

testHistoryAPI(); 